package A01Function;

import java.util.ArrayList;
import java.util.Collections;

public class FunctionDemo2 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"张无忌","adad","eel","张德明");
        list.stream().filter(new Function()::StringJudge).forEach(s -> System.out.println(s));
    }
    public Boolean StringJudge(String s){
        return s.startsWith("张") && s.length() == 3;
    }
}
class Function{
    public  Boolean StringJudge(String s){
        return s.startsWith("张") && s.length() == 3;
    }
}